package com.mycompany.crm.dao;

import com.mycompany.crm.base.BaseMapper;
import com.mycompany.crm.query.CustomerQuery;
import com.mycompany.crm.vo.Customer;

import java.util.List;
import java.util.Map;

/**
 * @author ljy
 */
public interface CustomerMapper extends BaseMapper<Customer,Integer> {

    /**
     * 多条件查询
     * @param customerQuery
     * @return
     */
    List<Customer> selectByParams(CustomerQuery customerQuery);

    /**
     *通过客户姓名查询客户信息
     * @param name
     * @return
     */
    Customer queryCustomerByName(String name);

    /**
     * 查询待流失的客户数据
     * @return
     */
    List<Customer> queryLossCustomers();

    /**
     * 批量更新客户的流失状态
     * @param customerLossIds
     * @return
     */
    int updateCustomerStateByIds(List<Integer> customerLossIds);

    /**
     * 查询客户贡献数据
     * @param customerQuery
     * @return
     */
    List<Map<String,Object>> queryCustomerContributionByParams(CustomerQuery customerQuery);


    /**
     * 查询客户构成数据的列表
     * @return
     */
    List<Map<String, Object>> countCustomerMake();

    /**
     * 查询客户服务数据的列表
     * @return
     */
    List<Map<String, Object>> countCustomerServe();
}